<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>终止Promise链条</title>
</head>

<body>
    <script>
        const p1 = new Promise((resolve, reject) => {
            resolve(1)
        })
        p1.then(value => {
            console.log(value) // 1
            // 这里没有返回值 所以默认返回 undefined
        }).then(value => {
            console.log(111)// undefined
        }).then(value => {
            console.log(222)// undefined
            return new Promise(() => { })//终止了链式
        }).then(value => {
            console.log(333)// 不执行
        }).catch(reason => {
            console.log(reason);
        })
    </script>
</body>

</html>